<template>
  <view class="consumerCard">
    <view class="content-wrap">
      <view class="detail">
        <image :src="image(data.face_image_id)" alt="" srcset="" class="img" />
        <view class="info">
          <view class="info-title"
            ><text>{{ data.title }}</text></view
          >
          <!-- <text class="info-category">{{ data.category }}</text> -->
          <view class="info-time" style="margin-top:40rpx">{{ format(data.start_dtt) }}——{{ format(data.end_dtt) }}</view>
        </view>
        <view class="btn" @tap="todetail">查看详情</view>
      </view>
      <view class="explain">到店支付专享</view>
      <view class="left-icon" />
      <view class="right-icon" />
    </view>
    <!-- <view class="cro">
     <view class="content">333333333</view>
    </view> -->
    <!-- <image
      :src="data.imgurl"
      alt=""
      srcset=""
      class="img"
    />
    <view class="text">
      <view class="title">{{data.title}}</view>
      <view class="introduction">{{data.introduction}}</view>
    </view> -->
  </view>
</template>

<script>
// 优惠券卡片
import "./index.scss";
import Taro from "@tarojs/taro";
import formatTime from "../../utils/formatTime"
import { getImage } from "../../utils/request";

export default {
  props: ["data"],
  data() {
    return {
    };
  },
  mounted() {
    console.log(this.data,"333");
  },
  methods: {
    format(time){
// return()
return formatTime(time, "yyyy-mm-dd");
    },

    image(id){
      return getImage(id)
    },

    todetail() {
      console.log(this.data, "ooo");
      Taro.navigateTo({
        url: `/pages/consumer/rules/index?id=${this.data._id}`,
      });
      // `../../pages/HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.srcId}`
    },
  },
};
</script>
